#include "stdafx.h"

using namespace sprite;

extern texture* tex,tex2;
extern image* img,img2;

void OnSize(HWND hWnd, WPARAM wParam, LPARAM lParam){

	switch(wParam){

		case SIZE_RESTORED:

			if(img){
			
				img->SetSquare(LOWORD(lParam),HIWORD(lParam));

				RECT rt;

				GetWindowRect(hWnd,&rt);

				//spriteRefresh(rt.left,rt.top,rt.right,rt.bottom);

				img->Setxy(0,0);

				float width,height;

				tex->GetSize(width,height);

				spriteRefresh(0,0,rt.right,rt.bottom);

			}			
	
	}

	InvalidateRect(hWnd,NULL,TRUE);

}